<!--
 * @Author: GKN
 * @Date: 2023-07-26 09:17:42
 * @LastEditTime: 2024-02-01 16:15:34
 * @LastEditors: GKN
 * @Description: 
 * @FilePath: \mod\src\view\components\card3.vue
 * 可以输入预定的版权声明、个性签名、空行等
-->
<template>
  <div>
    <div class="card">
        <div class="titleView">
            <div class="icon">
                <slot name="logoView"></slot>
                <span>{{ title }}</span>
            </div>
            <div class="more" @click="moreClick()">更多<img src="@/assets/img/more.png" alt=""></div>
        </div>
        <div class="main">
            <myEmpty :size="90" description="" v-if="!list||list.length==0" />
            <!-- <word /> -->
            <div v-if="isAnimation">
                <div class="item cursor-p" v-for="(item,i) in list" :key="i" @click="goInfo(item,title)">
                    <div class="yd"></div>
                    <div :class="isAnimation?(i==0?'animate three omit title':'omit title'):'omit title'">
                        <span v-for="items in item.name" :key="items" style="margin-right: 2px;">{{ items }}</span>
                    </div>
                </div>
            </div>
            <div v-if="!isAnimation">
                <div class="item cursor-p" v-for="(item,i) in list" :key="i" @click="goInfo(item,title)">
                    <div class="yd"></div>
                    <div class="title1 omit">
                        {{item.name}}
                    </div>
                </div>
            </div>
        </div>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from "vue-router";
const Router = useRouter();
import CryptoJS from 'crypto-js';
import { ref,reactive, onMounted,getCurrentInstance } from "vue";
import word from './word.vue';
const { proxy } = getCurrentInstance();
    const props = defineProps({
        title:{
            type: String,
            default: "",
        },
        list:{
            type: Object,
            default: [],
        },
        isAnimation:{
            type: blur,
            default: false,
        }

    })
    let emit = defineEmits(["titleClick"]);
    const moreClick = () => {
        emit("moreClick");
    };
    const goInfo=(item,name)=>{
        const routeUrl = Router.resolve({
            path:'/animatedly/info',
            query:{
                ob:proxy.$comJs.encry({
                    title:name,
                    id:item.newsId,
                    path:'/animatedly/list',
                    first_title:'首页',
                    first_path:-1
                })
            }
        });
        window.open(routeUrl.href, "_blank");
    }
</script>

<style lang='less' scoped>
    .card{
        width: 100%;
        height: 100%;
        background: #fff;
        border-radius: 10px;
        padding: 0 20px;
        box-sizing: border-box;
        .main{
            padding:10px 0;
            box-sizing: border-box;
            background: #fff;
            height: 200px;
            //overflow: hidden;
            .item{
                width: 100%;
                // height: 33.3%;
                margin-bottom:20px;
                display: flex;
                align-items: center;
                .yd{
                    width: 8px;
                    height: 8px;
                    border-radius: 50%;
                    background: #c5c5c5;
                    margin-right: 16px;
                }
                .title{
                    width: 90%;
                    color: #333333;
                    font-size: 14px;
                    display: flex;
                    align-items: center;
                }
                .title1{
                    width: 90%;
                    color: #333333;
                    font-size: 14px;
                }
            }
            .item:first-child{
                .title{
                    font-weight: bold;
                }
                
            }
        }
        .titleView{
            width: 100%;
            border-bottom:1px solid #EBEBEB;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding:20px 0;
            box-sizing: border-box;
            .icon{
                display: flex;
                align-items: center;
                span{
                    font-size: 16px;
                    color: #333;
                    font-weight: bold;
                    margin-left: 5px;
                }
                img{
                    width: 30px;
                    height: 30px;
                    margin-right: 5px;
                }
            }
            .more{
                display: flex;
                align-items: center;
                cursor: pointer;
                span{
                    font-size: 16px;
                    color: #8d8d8d;
                    font-weight: bold;
                }
                img{
                    width: 7px;
                    height: 12px;
                    margin-left: 5px;
                }
            }
        }
    }
</style>
